package com.yimi.policyservice.controller;

import com.yimi.policyservice.entity.base.system.SysDataDict;
import com.yimi.policyservice.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test/")
public class TestController {
    @Autowired
    private TestService testService;
    @Autowired
    private RedisTemplate<String,String> redisTemplate;
    @RequestMapping("v1")
    private SysDataDict test(){
        redisTemplate.opsForValue().set("name","test");
        String name = redisTemplate.opsForValue().get("name");
        System.out.println(name);
        SysDataDict test = testService.test();
        return test;
    }
    @RequestMapping("v2")
    private String test1(){
        return "1";
    }

}
